package com.coollang.smartbra.bleutil;

/**
 * Created by Administrator on 2016/11/16 0016.
 */

public class BleSendUtils {

    /**
     * 开始指令
     * 0 深蹲 1 深蹲跳 2 仰卧起坐 3 卷腹 4 俯卧撑 5 平板支撑
     *
     * @param position
     */
    public static void sendStartDataByPosition(int position) {
        byte bytes = (byte) 0x31;
        switch (position) {
            case 1:
                bytes = (byte) 0x37;
                break;
            case 2:
                bytes = (byte) 0x36;
                break;
            case 3:
                bytes = (byte) 0x33;
                break;
            case 4:
                bytes = (byte) 0x34;
                break;
            case 5:
                bytes = (byte) 0x35;
                break;
            case 6:
                bytes = (byte) 0x32;
                break;
            default:
        }
        BleUtil.getInstance().sendData(bytes);
    }

    /**
     * 结束指令
     * 0 深蹲 1 深蹲跳 2 仰卧起坐 3 卷腹 4 俯卧撑 5 平板支撑
     *
     * @param position
     */
    public static void sendEndDataByPosition(int position) {
        byte[] bytes = new byte[]{(byte) 0x37, (byte) 0x02};
        switch (position) {
            case 1:
                bytes = new byte[]{(byte) 0x37, (byte) 0x02};
                break;
            case 2:
                bytes = new byte[]{(byte) 0x36, (byte) 0x02};
                break;
            case 3:
                bytes = new byte[]{(byte) 0x33, (byte) 0x02};
                break;
            case 4:
                bytes = new byte[]{(byte) 0x34, (byte) 0x02};
                break;
            case 5:
                bytes = new byte[]{(byte) 0x35, (byte) 0x02};
                break;
            case 6:
                bytes = new byte[]{(byte) 0x32, (byte) 0x02};
                break;
            default:
        }
        BleUtil.getInstance().sendData(bytes);
    }
}
